package net.wangds.auth.job.repo.rdbms;

import net.wangds.auth.job.entity.GeneralJobRoleRef;
import net.wangds.data.RemovedEnum;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface JobRoleRefRepo extends JpaRepository<GeneralJobRoleRef, String> {

    Optional<GeneralJobRoleRef> findByJobIdAndRoleId(String jobId, String roleId);
    boolean existsByJobIdAndRoleId(String jobId, String roleId);

    List<GeneralJobRoleRef> findByJobIdAndRemoved(String jobId, RemovedEnum normal, Sort sort);
}
